/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jlibrarian.interfaces;

import jlibrarian.entities.Book;
import java.util.Collection;

/**
 *
 * @author dandelion8
 */


public interface BookManager
{
    /**
     * This method creates new book in database
     * @param book book to create
     */
    Book createBook(Book book);

    /**
     * This method deletes book from database
     * @param book book to delete
     */
    boolean deleteBook(Book book);

    /**
     * This method updates selected book in database (overwrites)
     * @param book book to update
     */
    boolean updateBook(Book book);

    /**
     * This method search books by given title
     * @param title Title to search
     * @return Collection of found books
     */
    Collection<Book> findBooksByTitle(String title);

    /**
     * This method search all books by given author
     * @param authors of books to search
     * @return Collection of books by given author.
     */
    Collection<Book> findBooksByAuthors(String authors);
    
    /**
     * This method search book by given id
     * @param id id of book to search
     * @return Book with given id or null if not found.
     */
    Book findBookById(int id);
    
    
    /**
     * This method returns all customers.
     * @return returns customers.
     */
    Collection<Book> getAllBooks();
    
    /**
     *  This method search all books by given author and title
     * @param authors authors of books to search
     * @param title title of book to search
     * @return Collection of books by given parameters
     */
    Collection<Book> findBooksByAuthorAndTitle(String authors, String title);
}
